var express = require('express')
var app = express()
const hostname = '192.168.3.6'
const port = 5000
app.all('*', function (req, res, next) {
	// console.log(req.method);
	res.header('Access-Control-Allow-Origin', '*')
	res.header('Access-Control-Allow-Headers', 'Content-type')
	res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS,PATCH')
	res.header('Access-Control-Max-Age', 1728000) //预请求缓存20天
	next()
})
app.use(express.static('./'))
app.listen(port, hostname, () => {
	console.log(`Server is running `)
})
